<%@page contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<form:form modelAttribute="page" id="pagerForm" method="post"
	action="${ctx}/role/list?navtabid=roleNav">
    <input type="hidden" name="pageNo" value="1" />
    <input type="hidden" id="pageSize" name="pageSize" value="${page.pageSize}" />
    <input type="hidden" name="orderBy" value="${page.orderBy}" />
    <input type="hidden" name="order" value="${page.order}" />
</form:form>
<div class="pageHeader"><shiro:hasPermission name="role:view">
	<form onsubmit="return navTabSearch(this);" action="${ctx}/role/list?navtabid=roleNav"
		method="post">
	
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>角色：<input type="text" name="name" value="" />
					</td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li><div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">检索</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>	
	</form></shiro:hasPermission>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<shiro:hasPermission name="role:add">
				<li><a class="add" target="dialog" href="${ctx}/role/add?navtabid=roleNav" target="navTab"><span>添加</span></a></li>
			</shiro:hasPermission>
			<li class="line">line</li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="40"><input type="checkbox" class="checkboxCtrl"
					group="c1" /></th>
				<th orderField="name" 
					class=" ${page.orderBy eq 'name' ? page.order : '' }" >name</th>
				<th orderField="show_name" 
					class=" ${page.orderBy eq 'show_name' ? page.order : '' }" >角色名称</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="item" items="${page.result}" varStatus="menu">
				<tr>
					<td><input type="checkbox" name="c1" value="" /></td>
				<td><c:out value='${item.name}'/></td>
				<td><c:out value='${item.showName}'/></td>
					<td>
					<shiro:hasPermission name="role:delete">
					<a  class="btnDel" href="${ctx}/role/delete/${item.id}"
						target="ajaxTodo" title="确定要删除${item.showName}吗?"  >删除</a></shiro:hasPermission>
					<shiro:hasPermission name="role:edit">
					<a  class="btnEdit" href="${ctx}/role/edit/${item.id}?navtabid=roleNav"
						target="dialog" title="修改${item.showName}">修改</a>
					</shiro:hasPermission>
                    <shiro:hasPermission name="role:permission">
                            <a  href="${ctx}/role/permissiontree/${item.id}?navtabid=roleNav"
                                target="dialog" title="${item.showName}角色对应权限" class="btnView"><span>角色对应权限</span></a>
                     </shiro:hasPermission>
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
		<%@ include file="/commons/panelBar.jsp"%>
</div>